現今的瀏覽器如 Firefox, Google Chrome 多以將僅 http 的網站和連結標註為不安全,所以於前一天所安裝的 Mautic 服務若要能正常的於客戶端運行,勢必是得用 https:// 開頭的網址。
sudo vim /etc/default/grub
GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"
sudo update-grub
sudo systemctl reboot
docker pull nginx:latest
# 這些資料夾和檔案,到時會藉由 mapping 的形式映射的 nginx 容器內的對應資料夾中
mkdir /opt/docker/nginx/conf.d -p
mkdir /opt/docker/nginx/cert -p
cd /opt/docker/nginx/cert
cat certificate.crt ca_bundle.crt >> ca_bundle_combine.crt
# 可以先用 notepad+ 等工具先行編輯好,
# 再透過如 FileZilla 工具上傳
server {
listen 443 ssl;
server_name <subdomain / domain name>;
# 到時是由容器中的 /etc/nginx/ 開始計算相對位置
ssl_certificate ./cert/ca_bundle_combine.crt;
ssl_certificate_key cert/private.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;
client_max_body_size 1024m;
location / {
proxy_set_header HOST $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://<你的 domain 實際ip>:8080/;
}
}
server {
listen 80;
server_name mautic.smlpoints.com;
return 301 https://$host$request_uri;
}
docker run -itd --name nginx -p 80:80 -p 443:443 -v /opt/docker/nginx/conf.d/nginx.conf:/etc/nginx/conf.d/nginx.conf -v /opt/docker/nginx/cert:/etc/nginx/cert -m 100m nginx